<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
.STYLE1 {
	font-size: 12px
}
-->
</style>
<center>
<table class="tableline" id="Table1" cellspacing="1" cellpadding="0" width="100%" border="0">
    <tr>
     <td colspan="7" class="STYLE4" align="center" bgcolor="#ffffff" colspan="2" height="40">留言信息管理列表
     &nbsp;&nbsp;&nbsp;&nbsp;
     </td>
     </tr>
    <tr align="center">
      <td width="10%" height="40" bgcolor="#ffffff">留言编号</td>
      <td width="20%" bgcolor="#ffffff">留言主题</td>
      <td width="20%" bgcolor="#ffffff">姓名</td>
      <td width="30%" bgcolor="#ffffff">留言内容</td>
      <td width="10%" bgcolor="#ffffff">留言状态</td>
      <td bgcolor="#ffffff">操作</td>
    </tr>
<c:if test="${!empty pm.datas}">
<c:forEach items="${pm.datas  }" var="message">
        <tr align="center">
          <td bgcolor="#ffffff">${message.id }</td>
          <td bgcolor="#ffffff"><a href="messageAdmin.do?method=findMessageById&id=${message.id}" >${message.topic }</a></td>
          <td bgcolor="#ffffff">${message.name }</td>
          <td bgcolor="#ffffff">${message.content}</td>
          <td bgcolor="#ffffff">
          <c:if test="${message.state == 0 }"><a href="messageAdmin.do?method=updateMessageState&id=${message.id}" ><img src="images/close.png" alt="更改状态" width="15" height="15" ></a></c:if>
          <c:if test="${message.state == 1 }"><a href="messageAdmin.do?method=updateMessageState&id=${message.id}" ><img width="15" height="15" alt="更改状态" src="images/open.png" ></a></c:if>
          </td>
          <td bgcolor="#ffffff"><a href="messageAdmin.do?method=delete&id=${message.id }">删除</a></td>
        </tr>
      </c:forEach>
    </c:if>
  </table>
  <pg:pager url="messageAdmin.do" items="${pm.total }" export="currentPageNumber=pageNumber">
	<pg:first>
		<a href="${pageUrl }">首页</a>

	</pg:first>
	<pg:prev>
		<a href="${pageUrl }">上一页</a>
	</pg:prev>
	<pg:pages>
		<c:choose>
			<c:when test="${currentPageNumber eq pageNumber}">
				<font color="red">${pageNumber }</font>
			</c:when>
			<c:otherwise>
				<a href="${pageUrl }">${pageNumber }</a>
			</c:otherwise>
		</c:choose>
	</pg:pages>
	<pg:next>
		<a href="${pageUrl }">下一页</a>
	</pg:next>
	<pg:last>
		<a href="${pageUrl }">尾页</a>
	</pg:last>
</pg:pager>
</center>
